package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum UnitType {

    GT(">", "&gt;"),
    GE(">=", "&ge;"),
    LT("<", "&lt;"),
    LE(">=", "&le;"),
    EQ("=", "="),
    IN("in", "in"),
    NE("!=", "!="),
    NIL("is null", "is null"),
    NOT_NULL("is not null", "is not null"),
    LIKE("like", "like"),
    NOT_LIKE("not like", "not like"),
    BETWEEN_AND("between and", "between and");

    private String unit;
    private String deUnit;

    public static UnitType getUnitType(String unit) {
        for (UnitType value : values()) {
            if (value.unit.equals(unit)) {
                return value;
            }
        }
        return null;
    }
}
